<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/18 0018
 * Time: 下午 1:49
 */
use yii\helpers\Url;
?>
<?php $this->beginBlock("content");?>
<div class="row">
    <div class="col-md-12 white-box">
        <form action="<?=Url::to(["set"])?>" method="post" rel-action="form" rel-before="submitBefore">

            <div class="row type-company">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="control-label">
                            区域经理名称
                        </label>
                        <input type="text" name="userInfo[name]" value="<?=@$ret["regionManagerInfo"]["name"]?>" class="form-control" placeholder="">
                        <div class="form-control-feedback" rel-mark="userInfo[name]"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="control-label">
                            账号
                        </label>
                        <input type="text" name="username" value="<?=@$ret["username"]?>" class="form-control" placeholder="">
                        <div class="form-control-feedback" rel-mark="username"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label">
                            密码
                        </label>
                        <input type="text" name="password" value="" class="form-control" placeholder="">
                        <div class="form-control-feedback" rel-mark="password"></div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label">
                            确认密码
                        </label>
                        <input type="text" name="password2" value="" class="form-control" placeholder="">
                        <div class="form-control-feedback" rel-mark="password2"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="control-label">支付宝账号</label>
                        <input type="text" name="userInfo[ali_account]" value="<?=@$ret["regionManagerInfo"]["ali_account"]?>" class="form-control" placeholder="">
                        <div class="form-control-feedback" rel-mark="ali_account"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <?=$this->render("@app/views/layouts/parts/cropper.php", [
                    "col_md" => 12,
                    "label_name" => "收钱码",
                    "input_value" => @$ret['regionManagerInfo']['rev_price_image'],
                    "rel_nModule" => 1,
                    "callback_input" => "rev_price_image",
                    "upload_dir" => "region_manager",
                    "ratio" => 0
                ])?>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <a target="_blank" href="https://jingyan.baidu.com/article/c1a3101e69fc6cde656debf7.html">【获取支付宝收款码说明】</a>
                    </div>
                </div>
            </div>
            <?php if (isset($ret["id"])):?>
                <input type="hidden" name="id" value="<?=$ret["id"]?>">
            <?php endif?>
            <button type="submit" class="btn btn-success waves-effect waves-light m-r-10 float-left">
                确认保存
            </button>
        </form>
    </div>

</div>
<?php $this->endBlock();?>
<?php $this->beginBlock("script")?>
<script>
    function submitBefore() {
        var password = $("[name=password]").val()
        var password2 = $("[name=password2]").val()
        if ( password && password != password2 ) {
            return {
                status: 0,
                message: "两次密码不一致"
            }
        }
        return true;
    }
</script>
<?php $this->endBlock();?>
